Modal → GCP audio separation migration#273
Merged
Conversation
Plan for deploying audio-separator as a Cloud Run GPU service, replacing the current Modal deployment. Includes ensemble preset support and Dockerfile for Cloud Run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- deploy_cloudrun.py: FastAPI server adapted from deploy_modal.py for Cloud Run with L4 GPU. Same API contract, in-memory job tracking, GCS model download on startup, ensemble preset support. - Dockerfile.cloudrun: CUDA 12.6 runtime, Python 3.11, FFmpeg, audio-separator[gpu] - api_client.py: Add `preset` parameter to separate_audio() and separate_audio_and_wait() for ensemble preset-based separation - deploy-to-cloudrun.yml: CI workflow to build and push to Artifact Registry Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Dockerfile: Download ensemble preset models (instrumental_clean + karaoke) during build. Eliminates cold-start model download. - Remove google-cloud-storage dependency (no GCS model download needed) - CI workflow: Switch to us-east4 (L4 GPU quota approved there) - Reduce startup probe period (models pre-loaded, startup is fast) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use COPY heredoc + separate RUN instead of inline python -c which Docker can't parse with internal quotes/newlines. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use Python 3.12 from deadsnakes PPA (onnxruntime-gpu needs >= 3.11) - Use apt ffmpeg instead of downloading static build - Add cloudbuild.yaml for building with baked models on GCP (E2_HIGHCPU_32 machine has enough RAM for model loading) - Update GHA workflow to use Cloud Build instead of local Docker Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cloud Build's Docker doesn't support BuildKit heredocs (COPY <<). Use a separate script file instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds -p/--preset as a mutually exclusive option alongside -m/--model and --models. Passes preset parameter through to API client. Usage: audio-separator-remote separate song.mp3 -p instrumental_clean Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When chaining separations (Stage 1 output → Stage 2 input), the input filename contains stem markers like _(Vocals)_ that confuse the Separator's stem grouping regex, causing it to only output 1 stem instead of 2. Strip these markers before processing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@coderabbitai ignore
Summary
Scope (this repo)
audio_separator/remote/deploy_cloudrun.py— Cloud Run server (adapted from deploy_modal.py)Dockerfile.cloudrun— Docker image for Cloud Run GPUaudio_separator/remote/api_client.py— Addpresetparameter.github/workflows/deploy-to-cloudrun.yml— CI/CD to Artifact RegistrySee
docs/archive/2026-03-22-modal-to-gcp-migration-plan.mdfor full plan.🤖 Generated with Claude Code